

import 'dart:ui';

import 'package:flutter/material.dart';

class BlurredContainer extends StatelessWidget {
  final Widget child;
  final double blurSigma; // 模糊程度

  BlurredContainer({required this.child, this.blurSigma = 10.0});

  @override
  Widget build(BuildContext context) {
    return BackdropFilter(
      filter: ImageFilter.blur(sigmaX: blurSigma, sigmaY: blurSigma),
      child: Container(
        decoration: BoxDecoration(
          color: Colors.white.withOpacity(0.3), // 根据需要设置颜色和透明度
          borderRadius: BorderRadius.circular(8.0), // 根据需要设置圆角
        ),
        child: child,
      ),
    );
  }
}